home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.text;
-
- import java.awt.Component;
- import java.awt.event.ActionEvent;
-
- class DefaultEditorKit$EndWordAction extends TextAction {
- private boolean select;
-
- DefaultEditorKit$EndWordAction(String nm, boolean select) {
- super(nm);
- this.select = select;
- }
-
- public void actionPerformed(ActionEvent e) {
- JTextComponent target = ((TextAction)this).getTextComponent(e);
- if (target != null) {
- try {
- int offs = target.getCaretPosition();
- int endOffs = Utilities.getWordEnd(target, offs);
- if (this.select) {
- target.moveCaretPosition(endOffs);
- } else {
- target.setCaretPosition(endOffs);
- }
- } catch (BadLocationException var5) {
- ((Component)target).getToolkit().beep();
- }
- }
-
- }
- }
-